.class public Lrexsee/security/RexseeCheckSum;
.super Ljava/lang/Object;
.source "RexseeCheckSum.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field private static final INTERFACE_NAME:Ljava/lang/String; = "CheckSum"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 0
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 29
    iput-object p1, p0, Lrexsee/security/RexseeCheckSum;->mBrowser:Lrexsee/core/browser/Browser;

    .line 30
    return-void
.end method


# virtual methods
.method public adler32(Ljava/lang/String;)J
    .locals 2
    .param p1, "data"    # Ljava/lang/String;

    .prologue
    .line 34
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lrexsee/security/RexseeCheckSum;->adler32(Ljava/lang/String;Z)J

    move-result-wide v0

    return-wide v0
.end method

.method public adler32(Ljava/lang/String;Z)J
    .locals 5
    .param p1, "data"    # Ljava/lang/String;
    .param p2, "isFile"    # Z

    .prologue
    .line 37
    if-eqz p2, :cond_0

    invoke-static {p1}, Lrexsee/core/utilities/Utilities;->getContent(Ljava/lang/String;)[B

    move-result-object v2

    move-object v1, v2

    .line 38
    .local v1, "bytes":[B
    :goto_0
    if-nez v1, :cond_1

    .line 39
    iget-object v2, p0, Lrexsee/security/RexseeCheckSum;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/security/RexseeCheckSum;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "Error on reading data."

    invoke-virtual {v2, v3, v4}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 40
    const-wide/16 v2, -0x1

    .line 44
    :goto_1
    return-wide v2

    .line 37
    .end local v1    # "bytes":[B
    :cond_0
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    move-object v1, v2

    goto :goto_0

    .line 42
    .restart local v1    # "bytes":[B
    :cond_1
    new-instance v0, Ljava/util/zip/Adler32;

    invoke-direct {v0}, Ljava/util/zip/Adler32;-><init>()V

    .line 43
    .local v0, "adler32":Ljava/util/zip/Adler32;
    invoke-virtual {v0, v1}, Ljava/util/zip/Adler32;->update([B)V

    .line 44
    invoke-virtual {v0}, Ljava/util/zip/Adler32;->getValue()J

    move-result-wide v2

    goto :goto_1
.end method

.method public crc32(Ljava/lang/String;)J
    .locals 2
    .param p1, "data"    # Ljava/lang/String;

    .prologue
    .line 47
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lrexsee/security/RexseeCheckSum;->crc32(Ljava/lang/String;Z)J

    move-result-wide v0

    return-wide v0
.end method

.method public crc32(Ljava/lang/String;Z)J
    .locals 5
    .param p1, "data"    # Ljava/lang/String;
    .param p2, "isFile"    # Z

    .prologue
    .line 50
    if-eqz p2, :cond_0

    invoke-static {p1}, Lrexsee/core/utilities/Utilities;->getContent(Ljava/lang/String;)[B

    move-result-object v2

    move-object v0, v2

    .line 51
    .local v0, "bytes":[B
    :goto_0
    if-nez v0, :cond_1

    .line 52
    iget-object v2, p0, Lrexsee/security/RexseeCheckSum;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/security/RexseeCheckSum;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "Error on reading data."

    invoke-virtual {v2, v3, v4}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 53
    const-wide/16 v2, -0x1

    .line 57
    :goto_1
    return-wide v2

    .line 50
    .end local v0    # "bytes":[B
    :cond_0
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    move-object v0, v2

    goto :goto_0

    .line 55
    .restart local v0    # "bytes":[B
    :cond_1
    new-instance v1, Ljava/util/zip/CRC32;

    invoke-direct {v1}, Ljava/util/zip/CRC32;-><init>()V

    .line 56
    .local v1, "crc32":Ljava/util/zip/CRC32;
    invoke-virtual {v1, v0}, Ljava/util/zip/CRC32;->update([B)V

    .line 57
    invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J

    move-result-wide v2

    goto :goto_1
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 19
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 15
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/security/RexseeCheckSum;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "CheckSum"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 23
    new-instance v0, Lrexsee/security/RexseeCheckSum;

    invoke-direct {v0, p1}, Lrexsee/security/RexseeCheckSum;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method
